home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
DDJ0992.ARJ
/
POST.ASC
< prev
next >
Wrap
Text File
|
1992-08-10
|
641b
|
39 lines
_POSTMORTEM DEBUGGING_
by Matt Pietrek
[EXAMPLE 1]
#include <windows.h>
#include <string.h>
#include <dos.h>
int MeaningOfLife = 0x42; // A meaningless global,
// for DFA demonstration
void Foo(void far *ptr)
{
_fstrlen(ptr); // This call will GP fault
}
static void Bar(void far *ptr)
{
void far *b; // Local var for DFA demonstration
b = ptr;
Foo(b);
}
int PASCAL WinMain(
HANDLE hInstance,
HANDLE hPrevInstance,
LPSTR lpszCmdLine,
int nCmdShow
)
{
Bar(MK_FP(1,0)); // pass bad pointer
return 0;
}